# -*- encoding: utf-8 -*-
from flask import Blueprint
from flask_api import status
import json

car_status_bp = Blueprint('car_status_bp', __name__)

@car_status_bp.route("/carPluginStatus", methods=['GET', 'POST'])
def getCarPluginStatus():
    auto_driver_plugin_status = "stop".encode("utf-8")
    task_plugin_status = "stop".encode("utf-8")
    serial_plugin_status = "stop".encode("utf-8")
    serial_connection_status = b'0'

    return_msg = {
        "driver_plugin_run_status": auto_driver_plugin_status.decode("utf8"),
        "task_plugin_run_status": task_plugin_status.decode("utf8"),
        "serial_plugin_run_status": serial_plugin_status.decode("utf8"),
        "serial_connection_status": serial_connection_status.decode('utf8')
    }
    return json.dumps(return_msg), status.HTTP_200_OK
